package cn.wolfcode.qo;

import cn.wolfcode.enums.BusinessReportEnum;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter@Getter
public class BusinessReportQueryObject extends QueryObject {
    private String groupByName = BusinessReportEnum.BUSINESS.name();
    private Long businessId;
    private Integer typeId;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    public String getGroupBy(){
        return BusinessReportEnum.valueOf(this.groupByName).getSql();
    }
}
